home *** CD-ROM | disk | FTP | other *** search
/ Leonardo the Inventor / Leonardo The Inventor (93026)(Broderbund)(Riverdeep)(2004).iso / LEOWINMV / SHARED.DIR / 03088_Script_VIDEO HANDLERS < prev    next >
Text File  |  1996-04-01  |  3KB  |  107 lines

  1. -- -----------------------------------------------------------
  2. -- Handler waitMovie calls waitVideo.
  3.  
  4. on waitMovie whichSprite
  5.   waitVideo whichSprite
  6. end
  7.  
  8. -- -----------------------------------------------------------
  9. -- Handler freezeDigitalVideo stops playing a video that is
  10. -- playing in channels 19 or 18.
  11.  
  12. on freezeDigitalVideo
  13.   if (the castNum of sprite 19 > 0) then
  14.     if (the castType of cast the  name of cast the castNum of sprite 19 = #digitalVideo) then
  15.       set whichSprite = 19
  16.     end if
  17.   else if (the castNum of sprite 18 > 0) then
  18.     if (the castType of cast the  name of cast the castNum of sprite 18 = #digitalVideo) then
  19.       set whichSprite = 18
  20.     end if
  21.   else
  22.     set whichSprite = 0
  23.   end if
  24.   
  25.   if (whichSprite > 0) then
  26.     set the movieRate of sprite whichSprite = 0
  27.   end if
  28. end
  29.  
  30. -- -----------------------------------------------------------
  31. -- Handler unfreezeDigitalVideo starts playing a video that is
  32. -- playing in channels 19 or 18.
  33.  
  34. on unfreezeDigitalVideo
  35.   if (the castNum of sprite 19 > 0) then
  36.     if (the castType of cast the  name of cast the castNum of sprite 19 = #digitalVideo) then
  37.       set whichSprite = 19
  38.     end if
  39.   else if (the castNum of sprite 18 > 0) then
  40.     if (the castType of cast the  name of cast the castNum of sprite 18 = #digitalVideo) then
  41.       set whichSprite = 18
  42.     end if
  43.   else
  44.     set whichSprite = 0
  45.   end if
  46.   
  47.   if (whichSprite > 0) then
  48.     set the movieRate of sprite whichSprite = 1
  49.   end if
  50. end
  51.  
  52. -- -----------------------------------------------------------
  53. -- Handler setVideoMovieRate sets the movierate of the digital
  54. -- video in the given sprite to the given rate.
  55.  
  56. on setVideoMovieRate whichSprite, theRate
  57.   set the movieRate of sprite whichSprite = theRate
  58. end
  59.  
  60. -- -----------------------------------------------------------
  61. -- Handler clearDigitalVideo removes from the stage a video that
  62. -- is in channels 19 or 18.
  63.  
  64. on clearDigitalVideo
  65.   if NOT (the machineType = 256) then exit -- to fix QT 2.1 offstage prob on Mac.
  66.   
  67.   if (the castNum of sprite 19 > 0) then
  68.     if (the castType of cast the  name of cast the castNum of sprite 19 = #digitalVideo) then
  69.       set whichSprite = 19
  70.     end if
  71.   else if (the castNum of sprite 18 > 0) then
  72.     if (the castType of cast the  name of cast the castNum of sprite 18 = #digitalVideo) then
  73.       set whichSprite = 18
  74.     end if
  75.   else
  76.     set whichSprite = 0
  77.   end if
  78.   
  79.   if (whichSprite > 0) then
  80.     set the locH of sprite whichSprite = -3000
  81.     updatestage
  82.   end if
  83. end
  84.  
  85. -- -----------------------------------------------------------
  86. -- Handler stopVideo stops playing the video in sprite 16
  87.  
  88. on stopVideo whichSprite
  89.   if (the type of sprite whichSprite = 16) then
  90.     set the movierate of sprite whichSprite to 0
  91.   end if
  92.   
  93.   -- -----------------------------------------------------------
  94.   -- Handler waitVideo plays the video in the given sprite
  95.   -- until either the video is finished or the mouse is clicked.
  96.   
  97. on waitVideo whichSprite
  98.   set the movieTime of sprite whichSprite = 0 -- rewind to beginning
  99.   set the movieRate of sprite whichSprite = 1 -- stop video and remove from screen  
  100.   
  101.   repeat while (not (the mouseDown)) and (the movieRate of sprite whichSprite <> 0)
  102.     updateStage
  103.   end repeat
  104.   
  105.   set the movieRate of sprite whichSprite = 0 -- stop video and remove from screen
  106. end
  107.